Standardize default option values, add 'exit' routine to I/O vectors
authorparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 17 Sep 2004 16:32:52 +0000 (16:32 +0000)
committerparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 17 Sep 2004 16:32:52 +0000 (16:32 +0000)
36 files changed:
gpsbabel/arcdist.c
gpsbabel/brauniger_iq.c
gpsbabel/cetus.c
gpsbabel/defs.h
gpsbabel/duplicate.c
gpsbabel/easygps.c
gpsbabel/filter_vecs.c
gpsbabel/garmin.c
gpsbabel/geo.c
gpsbabel/geoniche.c
gpsbabel/gpilots.c
gpsbabel/gpspilot.c
gpsbabel/gpx.c
gpsbabel/hsa_ndv.c
gpsbabel/html.c
gpsbabel/igc.c
gpsbabel/magproto.c
gpsbabel/mapsource.c
gpsbabel/navicache.c
gpsbabel/netstumbler.c
gpsbabel/ozi.c
gpsbabel/palmdoc.c
gpsbabel/pcx.c
gpsbabel/polygon.c
gpsbabel/position.c
gpsbabel/psitrex.c
gpsbabel/quovadis.c
gpsbabel/reverse_route.c
gpsbabel/saroute.c
gpsbabel/smplrout.c
gpsbabel/sort.c
gpsbabel/stackfilter.c
gpsbabel/text.c
gpsbabel/tiger.c
gpsbabel/vecs.c
gpsbabel/xcsv.c

index 7f49dffc678aa7d025ff02cd6e5d078aa90d7014..3fc13459a29d9c61816cd528c3e1c48c9e80875d 100644 (file)
@@ -39,13 +39,14 @@ typedef struct {
 static
 arglist_t arcdist_args[] = {
        {"file", &arcfileopt,  "File containing vertices of arc", 
-               ARGTYPE_FILE | ARGTYPE_REQUIRED},
+               NULL, ARGTYPE_FILE | ARGTYPE_REQUIRED},
        {"distance", &distopt, "Maximum distance from arc", 
-               ARGTYPE_FLOAT | ARGTYPE_REQUIRED},
-       {"exclude", &exclopt, "Exclude points close to the arc", ARGTYPE_BOOL},
-       {"points", &ptsopt, "Use distance from vertices not lines", 
+               NULL, ARGTYPE_FLOAT | ARGTYPE_REQUIRED},
+       {"exclude", &exclopt, "Exclude points close to the arc", NULL,
                ARGTYPE_BOOL},
-       {0, 0, 0, 0}
+       {"points", &ptsopt, "Use distance from vertices not lines", 
+               NULL, ARGTYPE_BOOL},
+       {0, 0, 0, 0, 0}
 };
 
 #define BADVAL 999999
index 3ab4a2fe30c5799d42aadb8872640ac176cf3f61..2d06c5753e2cc81d33d13a2f99a34001d138a734 100644 (file)
@@ -263,7 +263,7 @@ static void data_read(void)
 }
 
 static arglist_t brauniger_iq_args[] = {
-    {0, 0, 0, 0}
+    {0, 0, 0, 0, 0}
 };
 
 ff_vecs_t brauniger_iq_vecs = {
@@ -274,5 +274,6 @@ ff_vecs_t brauniger_iq_vecs = {
     NULL,
     data_read,
     NULL,
+    NULL, 
     brauniger_iq_args
 };
index fd17a0918505f94610c8b624d97a9d45346c9b27..a85c9d4877ca4e37c6eb5ead1d8277b2f2579b4e 100644 (file)
@@ -100,9 +100,9 @@ static char *appendicon = NULL;
 
 static
 arglist_t cetus_args[] = {
-       {"dbname", &dbname, "Database name", ARGTYPE_STRING },
+       {"dbname", &dbname, "Database name", NULL, ARGTYPE_STRING },
        {"appendicon", &appendicon, "Append icon_descr to description.",
-               ARGTYPE_BOOL },
+               NULL, ARGTYPE_BOOL },
        {0, 0, 0, 0 }
 };
 
@@ -422,5 +422,6 @@ ff_vecs_t cetus_vecs = {
        wr_deinit,
        data_read,
        data_write,
+       NULL,
        cetus_args,
 };
index f43d03e896b69d37bca17d3923f7aeffb48265ee..807d3dc8288a6ac99b48783bbc2a8de92974e81a 100644 (file)
@@ -234,6 +234,7 @@ typedef void (*ff_init) (char const *);
 typedef void (*ff_deinit) (void);
 typedef void (*ff_read) (void);
 typedef void (*ff_write) (void);
+typedef void (*ff_exit) (void);
 
 #ifndef DEBUG_MEM
 char * get_option(const char *iarglist, const char *argname);
@@ -332,6 +333,7 @@ typedef struct arglist {
        char *argstring;
        char **argval;
        char *helpstring;
+       char *defaultvalue;
        long argtype;
 } arglist_t;
 
@@ -352,6 +354,7 @@ typedef struct ff_vecs {
        ff_deinit wr_deinit;
        ff_read read;
        ff_write write;
+       ff_exit exit;
        arglist_t *args;
 } ff_vecs_t;
 
index afeed360317de76ac10a894c3c25ed98dc30088e..2d3b57464dd3cdf9998fbb8f97dd1213fad750df 100644 (file)
@@ -31,14 +31,14 @@ static char *correct_coords = NULL;
 static
 arglist_t dup_args[] = {
        {"shortname", &snopt, "Suppress duplicate waypoints based on name",
-               ARGTYPE_BOOL},
+               NULL, ARGTYPE_BOOL},
        {"location", &lcopt, "Suppress duplicate waypoint based on coords",
-               ARGTYPE_BOOL},
+               NULL, ARGTYPE_BOOL},
        {"all", &purge_duplicates, "Suppress all instances of duplicates",
-               ARGTYPE_BOOL},
+               NULL, ARGTYPE_BOOL},
        {"correct", &correct_coords, "Use coords from duplicate points", 
-               ARGTYPE_BOOL},
-       {0, 0, 0, 0}
+               NULL, ARGTYPE_BOOL},
+       {0, 0, 0, 0, 0}
 };
 
 
index 45e7400170126930a4e6f5cf0ae64fc0c8af0891..827d2057f9cb4f65a1fb2df54be64787cc8d8807 100644 (file)
 static FILE *file_in;
 static FILE *file_out;
 static void *mkshort_handle;
-static char *deficon = "Waypoint";
+static char *deficon = NULL;
 
 #define MYNAME "EasyGPS"
 
 static
 arglist_t easygps_args[] = {
-/*     {"deficon", &deficon, "Default icon name", ARGTYPE_STRING}, */
+/*     {"deficon", &deficon, "Default icon name", "Waypoint", 
+       ARGTYPE_STRING}, */
        {0, 0, 0, 0 }
 };
 
@@ -268,5 +269,6 @@ ff_vecs_t easygps_vecs = {
        wr_deinit,
        data_read,
        data_write,
+       NULL, 
        easygps_args
 };
index 1306bb83254852063fa48f5780c95870453b475c..aab1af133b3f6141af40150369d9fe18ce03e30e 100644 (file)
@@ -114,11 +114,33 @@ find_filter_vec(char *const vecname, char **opts)
 
                        if (vec->vec->args) {
                                for (ap = vec->vec->args; ap->argstring; ap++){
-                                       *ap->argval = get_option(*opts, ap->argstring);
+                                       char *opt = get_option(*opts, 
+                                                       ap->argstring);
+                                       if ( opts ) {
+                                               *ap->argval = opt;
+                                       }
+                                       else if ( ap->defaultvalue ) {
+                                               *ap->argval = xstrdup(
+                                                       ap->defaultvalue);
+                                       }
+                                       else {
+                                               *ap->argval = NULL;
+                                       }
                                }
                        }
                } else {
                        *opts = NULL;
+                       if (vec->vec->args) {
+                               for (ap = vec->vec->args; ap->argstring; ap++){
+                                       if ( ap->defaultvalue ) {
+                                               *ap->argval = xstrdup(
+                                                       ap->defaultvalue);
+                                       }
+                                       else {
+                                               *ap->argval = NULL;
+                                       }
+                               }
+                       }
                }
 
                xfree(v);
index b2c22b026cc85cfe157996f31666d3c3749e6cfc..898fc59ac8b95fe9b0c062498bd4ce4ea77b8643 100644 (file)
@@ -32,20 +32,21 @@ static GPS_PWay *tx_routelist;
 static GPS_PWay *cur_tx_routelist_entry;
 static GPS_PTrack *tx_tracklist;
 static GPS_PTrack *cur_tx_tracklist_entry;
-static char *getposn;
-static char *poweroff;
-static char *snlen;
-static char *snwhiteopt;
+static char *getposn = NULL;
+static char *poweroff = NULL;
+static char *snlen = NULL;
+static char *snwhiteopt = NULL;
 
 static
 arglist_t garmin_args[] = {
-       { "snlen", &snlen, "Length of generated shortnames", ARGTYPE_INT },
+       { "snlen", &snlen, "Length of generated shortnames", NULL, 
+               ARGTYPE_INT },
        { "snwhite", &snwhiteopt, "(0/1) Allow whitespace synth. shortnames",
-               ARGTYPE_BOOL},
+               NULL, ARGTYPE_BOOL},
        { "get_posn", &getposn, "Return current position as a waypoint", 
-               ARGTYPE_BOOL},
+               NULL, ARGTYPE_BOOL},
        { "power_off", &poweroff, "Command unit to power itself down", 
-               ARGTYPE_BOOL},
+               NULL, ARGTYPE_BOOL},
        { 0, 0, 0, 0}
 };
 
@@ -624,6 +625,7 @@ ff_vecs_t garmin_vecs = {
        rw_deinit,
        data_read,
        data_write,
+       NULL,
        garmin_args
 };
 
index ceb14b24251d9390bbc4f73970fa4ffcd968a818..9e8eeca10af008cc95b7b389c50a95fef1daed9c 100644 (file)
@@ -29,7 +29,7 @@ static int in_type;
 static int in_cdata;
 static char *cdatastr;
 static char *typestr;
-static char *deficon;
+static char *deficon = NULL;
 
 static waypoint *wpt_tmp;
 
@@ -38,8 +38,8 @@ FILE *ofd;
 
 static
 arglist_t geo_args[] = {
-       {"deficon", &deficon, "Default icon name", ARGTYPE_STRING },
-       {0, 0, 0, 0}
+       {"deficon", &deficon, "Default icon name", NULL, ARGTYPE_STRING },
+       {0, 0, 0, 0, 0}
 };
 
 #define MYNAME "geo"
@@ -293,5 +293,6 @@ ff_vecs_t geo_vecs = {
        geo_wr_deinit,
        geo_read,
        geo_write,
+       NULL, 
        geo_args
 };
index 4302ff2799fd35438bff190cdaad92f3782d935c..60f955c70b3f3b6790ab2d3e70d907bf4572aacb 100644 (file)
@@ -40,9 +40,9 @@ static char *Arg_category = NULL;
 static
 arglist_t Args[] = {
        {"dbname", &Arg_dbname,
-           "Database name (filename)", ARGTYPE_STRING },
+           "Database name (filename)", NULL, ARGTYPE_STRING },
        {"category", &Arg_category,
-           "Category name (Cache)", ARGTYPE_STRING },
+           "Category name (Cache)", NULL, ARGTYPE_STRING },
        {0, 0, 0, 0 }
 };
 
@@ -532,5 +532,6 @@ ff_vecs_t geoniche_vecs =
        wr_deinit,
        data_read,
        data_write,
+       NULL, 
        Args
 };
index 27824e5e64ce8c63907181dd12aa66b61ccb1717..0a95644fbeaa041d310c23ab95bc8aaaca09e0f6 100644 (file)
@@ -160,8 +160,8 @@ static char *dbname = NULL;
 
 static
 arglist_t my_args[] = {
-       {"dbname", &dbname, "Database name", ARGTYPE_STRING},
-       {0, 0, 0, 0}
+       {"dbname", &dbname, "Database name", NULL, ARGTYPE_STRING},
+       {0, 0, 0, 0, 0}
 };
 
 static void
@@ -414,5 +414,6 @@ ff_vecs_t gpilots_vecs = {
        wr_deinit,
        data_read,
        data_write,
+       NULL, 
        my_args
 };
index 5edc2151328a4b8ae9632974c6a2bf98471fe246..7863af855d9ed0d813b8a4f3f657de8a8a07d52a 100644 (file)
@@ -54,8 +54,8 @@ static char *dbname = NULL;
 
 static
 arglist_t gpspilot_args[] = {
-        {"dbname", &dbname, "Database name", ARGTYPE_STRING},
-        {0, 0, 0, 0}
+        {"dbname", &dbname, "Database name", NULL, ARGTYPE_STRING},
+        {0, 0, 0, 0, 0}
 };
 
 static void
@@ -253,5 +253,6 @@ ff_vecs_t gpspilot_vecs = {
        wr_deinit,
        data_read,
        data_write,
+       NULL, 
        gpspilot_args
 };
index b1caa107c4ab032b10f8014b104fd5037e72b215..7b9830da3743eaac4ac2fbf21d5b1ac39f5e1807 100644 (file)
@@ -1288,13 +1288,18 @@ static
 arglist_t gpx_args[] = {
        { "gsshortnames", &gsshortnames, 
                "Prefer shorter descriptions from Groundspeak files",
-               ARGTYPE_BOOL },
-       { "snlen", &snlen, "Length of generated shortnames", ARGTYPE_INT },
+               NULL, ARGTYPE_BOOL },
+       { "snlen", &snlen, "Length of generated shortnames", 
+               NULL, ARGTYPE_INT },
        { "suppresswhite", &suppresswhite, 
-               "Suppress whitespace in generated shortnames", ARGTYPE_BOOL },
-       { "logpoint", &opt_logpoint, "Create waypoints from geocache log entries", ARGTYPE_BOOL },
-       { "urlbase", &urlbase, "Base URL for link tag in output", ARGTYPE_STRING},
-       { 0, 0, 0, 0 }
+               "Suppress whitespace in generated shortnames", 
+               NULL, ARGTYPE_BOOL },
+       { "logpoint", &opt_logpoint, 
+               "Create waypoints from geocache log entries", 
+               NULL, ARGTYPE_BOOL },
+       { "urlbase", &urlbase, "Base URL for link tag in output", 
+               NULL, ARGTYPE_STRING},
+       { 0, 0, 0, 0, 0 }
 };
 
 ff_vecs_t gpx_vecs = {
@@ -1305,5 +1310,6 @@ ff_vecs_t gpx_vecs = {
        gpx_wr_deinit,  
        gpx_read,
        gpx_write,
+       NULL, 
        gpx_args,
 };
index 7e37a67d26e95a2ededbb656e3f06d974f28e044..7cfa2c66d4963e34477562ef6d2ed93fd8477580 100644 (file)
@@ -42,8 +42,7 @@ FILE *ofd;
 
 static
 arglist_t hsa_ndv_args[] = {
-//     {"deficon", &deficon, "Default icon name", ARGTYPE_STRING },
-       {0, 0, 0, 0}
+       {0, 0, 0, 0, 0}
 };
 
 #define MYNAME "HsaNdv"
@@ -352,6 +351,7 @@ ff_vecs_t HsaEndeavourNavigator_vecs = {
        hsa_ndv_wr_deinit,
        hsa_ndv_read,
        hsa_ndv_write,
+       NULL, 
        hsa_ndv_args
 };
 
index a3bffbe2776bc9b039e3c457d978da0ea46f9a42..bc00b547e75e89c62f832d5f643576d4e39b932e 100644 (file)
@@ -36,12 +36,12 @@ static char *includelogs = NULL;
 static
 arglist_t html_args[] = {
        { "stylesheet", &stylesheet, 
-               "Path to HTML style sheet", ARGTYPE_STRING },
+               "Path to HTML style sheet", NULL, ARGTYPE_STRING },
        { "encrypt", &encrypt,
-               "Encrypt hints using ROT13", ARGTYPE_BOOL },
+               "Encrypt hints using ROT13", NULL, ARGTYPE_BOOL },
        { "logs", &includelogs, 
-               "Include groundspeak logs if present", ARGTYPE_BOOL },
-       {0, 0, 0, 0}
+               "Include groundspeak logs if present", NULL, ARGTYPE_BOOL },
+       {0, 0, 0, 0, 0}
 };
 
 
@@ -260,5 +260,6 @@ ff_vecs_t html_vecs = {
        wr_deinit,
        NULL,
        data_write,
+       NULL, 
        html_args
 };
index ef2af23498a5b5398683bd5a82db839bdc19ba11..5ccbfb0c6c169a926c9fe3d4dcd9d6ac077990e9 100644 (file)
@@ -887,8 +887,9 @@ static void data_write(void)
 
 static arglist_t igc_args[] = {
     {"timeadj", &timeadj,
-     "(integer sec or 'auto') Barograph to GPS time diff", ARGTYPE_STRING},
-    {0, 0, 0, 0}
+     "(integer sec or 'auto') Barograph to GPS time diff", 
+     NULL, ARGTYPE_STRING},
+    {0, 0, 0, 0, 0}
 };
 
 ff_vecs_t igc_vecs = {
@@ -899,5 +900,6 @@ ff_vecs_t igc_vecs = {
     wr_deinit,
     data_read,
     data_write,
+    NULL, 
     igc_args
 };
index 4c94064671f1e6b06028ee1d388e456f1854e34f..87424e2049d2bb05e7277c539d5b51c6a66bacd9 100644 (file)
@@ -709,18 +709,19 @@ termwrite(char *obuf, int size)
  */
 static
 arglist_t mag_sargs[] = {
-       {"baud", &bs, "Numeric value of bitrate (baud=4800)", ARGTYPE_INT },
+       {"baud", &bs, "Numeric value of bitrate (baud=4800)", NULL,
+               ARGTYPE_INT },
        {"noack", &noack, "Suppress use of handshaking in name of speed",
-               ARGTYPE_BOOL},
-       {"deficon", &deficon, "Default icon name", ARGTYPE_STRING },
-       {"nukewpt", &nukewpt, "Delete all waypoints", ARGTYPE_BOOL },
-       {0, 0, 0, 0}
+               NULL, ARGTYPE_BOOL},
+       {"deficon", &deficon, "Default icon name", NULL, ARGTYPE_STRING },
+       {"nukewpt", &nukewpt, "Delete all waypoints", NULL, ARGTYPE_BOOL },
+       {0, 0, 0, 0, 0}
 };
 
 static
 arglist_t mag_fargs[] = {
-       {"deficon", &deficon, "Default icon name", ARGTYPE_STRING },
-       {0, 0, 0, 0}
+       {"deficon", &deficon, "Default icon name", NULL, ARGTYPE_STRING },
+       {0, 0, 0, 0, 0}
 };
 
 static void
@@ -1391,6 +1392,7 @@ ff_vecs_t mag_svecs = {
        mag_deinit,     
        mag_read,
        mag_write,
+       NULL, 
        mag_sargs
 };
 
@@ -1402,5 +1404,6 @@ ff_vecs_t mag_fvecs = {
        mag_deinit,     
        mag_read,
        mag_write,
+       NULL, 
        mag_fargs
 };
index 889905c9fdd661851f7b7bcd3364a150e6f51a72..d303814ac5d417e72d4a02880291148e7f5a935f 100644 (file)
@@ -65,23 +65,30 @@ static void *read_route_wpt_mkshort_handle;
 #define MPSNOTESBUFFERLEN      4096
 #define MPSDESCBUFFERLEN       4096
 
-char *snlen;
-char *snwhiteopt;
-char *mpsverout;
+char *snlen = NULL;
+char *snwhiteopt = NULL;
+char *mpsverout = NULL;
 char *mpsmergeout = NULL;
 char *mpsusedepth = NULL;
 char *mpsuseprox = NULL;
 
 static
 arglist_t mps_args[] = {
-       {"snlen", &snlen, "Length of generated shortnames", ARGTYPE_INT },
+       {"snlen", &snlen, "Length of generated shortnames", NULL, ARGTYPE_INT },
        { "snwhite", &snwhiteopt, "(0/1) Allow whitespace synth. shortnames",
-               ARGTYPE_BOOL},
-       {"mpsverout", &mpsverout, "Version of mapsource file to generate (3,4,5)", ARGTYPE_INT },
-       {"mpsmergeout", &mpsmergeout, "Merge output with existing file", ARGTYPE_BOOL },
-       {"mpsusedepth", &mpsusedepth, "Use depth values on output (default is ignore)", ARGTYPE_BOOL },
-       {"mpsuseprox", &mpsuseprox, "Use proximity values on output (default is ignore)", ARGTYPE_BOOL },
-       {0, 0, 0, 0}
+               NULL, ARGTYPE_BOOL},
+       {"mpsverout", &mpsverout, 
+               "Version of mapsource file to generate (3,4,5)", NULL,
+               ARGTYPE_INT },
+       {"mpsmergeout", &mpsmergeout, "Merge output with existing file", 
+               NULL, ARGTYPE_BOOL },
+       {"mpsusedepth", &mpsusedepth, 
+               "Use depth values on output (default is ignore)", NULL,
+               ARGTYPE_BOOL },
+       {"mpsuseprox", &mpsuseprox, 
+               "Use proximity values on output (default is ignore)", 
+               NULL, ARGTYPE_BOOL },
+       {0, 0, 0, 0, 0}
 };
 
 /*
@@ -2162,5 +2169,6 @@ ff_vecs_t mps_vecs = {
        mps_wr_deinit,
        mps_read,
        mps_write,
+       NULL,
        mps_args
 };
index bc825dfdb3fd5a7e0ec291bd29e40442c888721c..0d42a38bab8fa8cbd5851f03b1942fb86163d87f 100644 (file)
@@ -27,13 +27,13 @@ static waypoint *wpt_tmp;
 FILE *fd;
 FILE *ofd;
 
-static char *noretired;
+static char *noretired = NULL;
 
 static
 arglist_t nav_args[] = {
        {"noretired", &noretired, "Suppress retired geocaches.",
-               ARGTYPE_BOOL },
-       {0, 0, 0, 0}
+               NULL, ARGTYPE_BOOL },
+       {0, 0, 0, 0, 0}
 };
 
 #define MYNAME "navicache"
@@ -262,5 +262,6 @@ ff_vecs_t navicache_vecs = {
        nav_wr_deinit,
        nav_read,
        nav_write,
+       NULL, 
        nav_args,
 };
index 5f5dba9af225f1dd00a0a42d3cbfc2a220dc9373..1674215e60187e6d0e976b64db07d2cee8163896 100644 (file)
 #include <ctype.h>
 
 static FILE *file_in;
-static char *nseicon = "Red Square";
-static char *nsneicon = "Green Square";
-static char *seicon = "Red Diamond";
-static char *sneicon = "Green Diamond";
+static char *nseicon = NULL;
+static char *nsneicon = NULL;
+static char *seicon = NULL;
+static char *sneicon = NULL;
 static char *snmac = NULL;
-static char *optnseicon = NULL;
-static char *optnsneicon = NULL;
-static char *optseicon = NULL;
-static char *optsneicon = NULL;
 
 static void    fix_netstumbler_dupes(void);
 
@@ -41,21 +37,21 @@ static void fix_netstumbler_dupes(void);
 
 static
 arglist_t netstumbler_args[] = {
-       {"nseicon", &optnseicon, "Non-stealth encrypted icon name", ARGTYPE_STRING },
-       {"nsneicon", &optnsneicon, "Non-stealth non-encrypted icon name", ARGTYPE_STRING },
-       {"seicon", &optseicon, "Stealth encrypted icon name", ARGTYPE_STRING },
-       {"sneicon", &optsneicon, "Stealth non-encrypted icon name", ARGTYPE_STRING },
-       {"snmac", &snmac, "Shortname is MAC address", ARGTYPE_BOOL },
-       {0, 0, 0, 0}
+       {"nseicon", &nseicon, "Non-stealth encrypted icon name", 
+               "Red Square", ARGTYPE_STRING },
+       {"nsneicon", &nsneicon, "Non-stealth non-encrypted icon name", 
+               "Green Square", ARGTYPE_STRING },
+       {"seicon", &seicon, "Stealth encrypted icon name", 
+               "Red Diamond", ARGTYPE_STRING },
+       {"sneicon", &sneicon, "Stealth non-encrypted icon name", 
+               "Green Diamond", ARGTYPE_STRING },
+       {"snmac", &snmac, "Shortname is MAC address", NULL, ARGTYPE_BOOL },
+       {0, 0, 0, 0, 0}
 };
 
 static void
 rd_init(const char *fname)
 {
-       nseicon = optnseicon?optnseicon:"Red Square";
-       nsneicon = optnsneicon?optnsneicon:"Green Square";
-       seicon = optseicon?optseicon:"Red Diamond";
-       sneicon = optsneicon?optsneicon:"Green Diamond";
        file_in = xfopen(fname, "r", MYNAME);
 }
 
@@ -303,5 +299,6 @@ ff_vecs_t netstumbler_vecs = {
        NULL,
        data_read,
        NULL,
+       NULL,
        netstumbler_args
 };
index cf9915c531182ea857dd1fda5498c7d7af1211ed..ff9487571706a5a35174feca17155aca4ab28d4a 100644 (file)
@@ -40,22 +40,22 @@ static int track_out_count;
 static int route_out_count;
 static int route_wpt_count;
 
-static char *snlenopt;
-static char *snwhiteopt;
-static char *snupperopt;
-static char *snuniqueopt;
+static char *snlenopt = NULL;
+static char *snwhiteopt = NULL;
+static char *snupperopt = NULL;
+static char *snuniqueopt = NULL;
 
 static
 arglist_t ozi_args[] = {
        {"snlen", &snlenopt, "Max synthesized shortname length",
-               ARGTYPE_INT},
+               NULL, ARGTYPE_INT},
        {"snwhite", &snwhiteopt, "(0/1) Allow whitespace synth. shortnames",
-               ARGTYPE_BOOL},
+               NULL, ARGTYPE_BOOL},
        {"snupper", &snupperopt, "(0/1) UPPERCASE synth. shortnames",
-               ARGTYPE_BOOL},
+               NULL, ARGTYPE_BOOL},
        {"snunique", &snuniqueopt, "(0/1) Make synth. shortnames unique",
-               ARGTYPE_BOOL},
-       {0, 0, 0, 0}
+               NULL, ARGTYPE_BOOL},
+       {0, 0, 0, 0, 0}
 };
 
 gpsdata_type ozi_objective;
@@ -698,5 +698,6 @@ ff_vecs_t ozi_vecs = {
     wr_deinit,
     data_read,
     data_write,
+    NULL,
     ozi_args
 };
index f456e3489dbec1024c88b1ed30ec26932d3761ec..40cf79b003c554b2e20b6a333daee3a18d0b3a9d 100644 (file)
@@ -67,14 +67,16 @@ struct buffer {
 static
 arglist_t palmdoc_args[] = {
        { "nosep", &suppresssep, 
-               "Suppress separator lines between waypoints", ARGTYPE_BOOL },
-       {"dbname", &dbname, "Database name", ARGTYPE_STRING },
-       {"encrypt", &encrypt, "Encrypt hints with ROT13", ARGTYPE_BOOL },
+               "Suppress separator lines between waypoints", NULL,
+               ARGTYPE_BOOL },
+       {"dbname", &dbname, "Database name", NULL, ARGTYPE_STRING },
+       {"encrypt", &encrypt, "Encrypt hints with ROT13", NULL,
+               ARGTYPE_BOOL },
        { "logs", &includelogs,
-               "Include groundspeak logs if present", ARGTYPE_BOOL },
+               "Include groundspeak logs if present", NULL, ARGTYPE_BOOL },
        { "bookmarks_short", &bmid, "Include short name in bookmarks", 
-               ARGTYPE_BOOL },
-       {0, 0, 0, 0}
+               NULL, ARGTYPE_BOOL },
+       {0, 0, 0, 0, 0}
 };
 
 static struct buffer buf;
@@ -608,6 +610,7 @@ ff_vecs_t palmdoc_vecs = {
        wr_deinit,
        NULL,
        data_write,
+       NULL, 
        palmdoc_args
 };
 
index 6ac56afad01f2618a61940a8c680c16cf38c52d8..4b4997b6dbb8571bfec15886e306c283329668d7 100644 (file)
 static FILE *file_in;
 static FILE *file_out;
 static void *mkshort_handle;
-static char *optdeficon = NULL;
-static char *deficon = "Waypoint";
+static char *deficon = NULL;
 
 #define MYNAME "PCX"
 
 static
 arglist_t pcx_args[] = {
-       {"deficon", &optdeficon, "Default icon name", ARGTYPE_STRING },
-       {0, 0, 0, 0}
+       {"deficon", &deficon, "Default icon name", "Waypoint", 
+               ARGTYPE_STRING },
+       {0, 0, 0, 0, 0}
 };
 
 static void
 rd_init(const char *fname)
 {
-       if ( optdeficon ) {
-               deficon = optdeficon;
-       }
-       else {
-               deficon = "Waypoint";
-       }
        file_in = xfopen(fname, "r", MYNAME);
 }
 
@@ -58,12 +52,6 @@ rd_deinit(void)
 static void
 wr_init(const char *fname)
 {
-       if ( optdeficon ) {
-               deficon = optdeficon;
-       }
-       else {
-               deficon = "Waypoint";
-       }
        file_out = xfopen(fname, "w", MYNAME);
        mkshort_handle = mkshort_new_handle();
 }
@@ -284,5 +272,6 @@ ff_vecs_t pcx_vecs = {
        wr_deinit,
        data_read,
        data_write,
+       NULL,
        pcx_args
 };
index fd7850c6ac90d21040a0ad1ed4cde2a7bff99ec9..174eec4c647d947dc539b378cb0d21c2e498cda5 100644 (file)
@@ -44,10 +44,10 @@ typedef struct {
 static
 arglist_t polygon_args[] = {
        {"file", &polyfileopt,  "File containing vertices of polygon",
-               ARGTYPE_FILE | ARGTYPE_REQUIRED },
+               NULL, ARGTYPE_FILE | ARGTYPE_REQUIRED },
        {"exclude", &exclopt, "Exclude points inside the polygon",
-               ARGTYPE_BOOL },
-       {0, 0, 0, 0}
+               NULL, ARGTYPE_BOOL },
+       {0, 0, 0, 0, 0}
 };
 
 static void polytest ( double lat1, double lon1,
index b7d6e3dca9202ec998b6089834485d17cee2bff9..9105dfff0a2183dc27d08d0c498af1e4c87f644b 100644 (file)
@@ -29,12 +29,12 @@ extern queue waypt_head;
 static route_head *cur_rte = NULL;
 
 static double pos_dist;
-static char *distopt;
+static char *distopt = NULL;
 static char *purge_duplicates = NULL;
-static char *latopt;
-static char *lonopt;
-static char *exclopt;
-static char *nosort;
+static char *latopt = NULL;
+static char *lonopt = NULL;
+static char *exclopt = NULL;
+static char *nosort = NULL;
 
 waypoint * home_pos;
 
@@ -45,24 +45,26 @@ typedef struct {
 static
 arglist_t position_args[] = {
        {"distance", &distopt, "Maximum positional distance",
-               ARGTYPE_FLOAT | ARGTYPE_REQUIRED },
-       {"all", &purge_duplicates, "Suppress all points close to other points", ARGTYPE_BOOL }, 
-       {0, 0, 0, 0}
+               NULL, ARGTYPE_FLOAT | ARGTYPE_REQUIRED },
+       {"all", &purge_duplicates, 
+               "Suppress all points close to other points", 
+               NULL, ARGTYPE_BOOL }, 
+       {0, 0, 0, 0, 0}
 };
 
 static
 arglist_t radius_args[] = {
        {"lat", &latopt,       "Latitude for center point (D.DDDDD)",
-               ARGTYPE_FLOAT | ARGTYPE_REQUIRED },
+               NULL, ARGTYPE_FLOAT | ARGTYPE_REQUIRED },
        {"lon", &lonopt,       "Longitude for center point (D.DDDDD)",
-               ARGTYPE_FLOAT | ARGTYPE_REQUIRED },
+               NULL, ARGTYPE_FLOAT | ARGTYPE_REQUIRED },
        {"distance", &distopt, "Maximum distance from center",
-               ARGTYPE_FLOAT | ARGTYPE_REQUIRED },
+               NULL, ARGTYPE_FLOAT | ARGTYPE_REQUIRED },
        {"exclude", &exclopt,  "Exclude points close to center",
-               ARGTYPE_BOOL },
+               NULL, ARGTYPE_BOOL },
        {"nosort", &nosort,    "Inhibit sort by distance to center.",
-               ARGTYPE_BOOL },
-       {0, 0, 0, 0}
+               NULL, ARGTYPE_BOOL },
+       {0, 0, 0, 0, 0}
 };
 
 static double
index 00336f1efd8f4e2c9fb7abfb98e501f26ff03968..9166f830f63764c00e956a8f3feec65dfebae414 100755 (executable)
@@ -56,8 +56,9 @@ char *snlen;
 
 static
 arglist_t psit_args[] = {
-/*     {"snlen", &snlen, "Length of generated shortnames", ARGTYPE_INT }, */
-       {0, 0, 0, 0}
+/*     {"snlen", &snlen, "Length of generated shortnames", 
+       NULL, ARGTYPE_INT }, */
+       {0, 0, 0, 0, 0}
 };
 
 /* Taken from PsiTrex 1.13 */
@@ -804,5 +805,6 @@ ff_vecs_t psit_vecs = {
        psit_wr_deinit,
        psit_read,
        psit_write,
+       NULL, 
        psit_args
 };
index 9a2546f190952029f2f18ad08169cc9498902e1d..a5274f801b5de14785c3fa34d666d4d158625c8c 100644 (file)
@@ -35,8 +35,8 @@ static char *dbname = NULL;
 
 static
 arglist_t quovadis_args[] = {
-       {"dbname", &dbname, "Database name", ARGTYPE_STRING},
-       {0, 0, 0, 0}
+       {"dbname", &dbname, "Database name", NULL, ARGTYPE_STRING},
+       {0, 0, 0, 0, 0}
 };
 
 static struct qv_icon_mapping mapping[] = {
@@ -291,5 +291,6 @@ ff_vecs_t quovadis_vecs = {
        wr_deinit,
        data_read,
        data_write,
+       NULL, 
        quovadis_args
 };
index 3365372512c42c381994571e3c192abfdf530c0d..9589c7450ef06c547ad09ef4272244dd7e917189 100644 (file)
@@ -25,7 +25,7 @@
 
 static
 arglist_t reverse_route_args[] = {
-       {0, 0, 0, 0}
+       {0, 0, 0, 0, 0}
 };
 
 void 
index 00e44a4441692fa2c337666a1df03ec6de664a4b..23152112e2d645673039bd430c5504bf787e84a4 100644 (file)
@@ -34,9 +34,10 @@ char *turns_only = NULL;
 static
 arglist_t saroute_args[] = {
        {"turns_important", &turns_important, 
-               "Keep turns if simplify filter is used", ARGTYPE_BOOL },
+               "Keep turns if simplify filter is used", 
+               NULL, ARGTYPE_BOOL },
        {"turns_only", &turns_only, "Only read turns; skip all other points",
-               ARGTYPE_BOOL },
+               NULL, ARGTYPE_BOOL },
        {0, 0, 0, 0 }
 };
 
@@ -275,5 +276,6 @@ ff_vecs_t saroute_vecs = {
        NULL,
        my_read,
        NULL,
+       NULL, 
        saroute_args
 };
index 3c3b0a17bc266b1ea83db4cf8310bacf274dbf6e..da21456357030d0d4f32b2f3e9abe95341a7ea6e 100644 (file)
@@ -30,8 +30,8 @@ static char *countopt = NULL;
 static
 arglist_t routesimple_args[] = {
        {"count", &countopt,  "Maximum number of points in route", 
-               ARGTYPE_INT | ARGTYPE_REQUIRED},
-       {0, 0, 0, 0}
+               NULL, ARGTYPE_INT | ARGTYPE_REQUIRED},
+       {0, 0, 0, 0, 0}
 };
 
 struct xte_intermed;
index c773e65eb7120c34cc0aa1b743268729aac20baa..e91af8317aaa42ccbfe38f7c2b2c827d0c3f70f9 100644 (file)
@@ -35,10 +35,13 @@ static char *opt_sm_gcid, *opt_sm_shortname, *opt_sm_description;
 
 static
 arglist_t sort_args[] = {
-       {"gcid", &opt_sm_gcid, "Sort by numeric geocache ID", ARGTYPE_BOOL },
-       {"shortname", &opt_sm_shortname, "Sort by waypoint short name", ARGTYPE_BOOL },
-       {"description", &opt_sm_description, "Sort by waypoint description", ARGTYPE_BOOL },
-       {0, 0, 0, 0}
+       {"gcid", &opt_sm_gcid, "Sort by numeric geocache ID", 
+               NULL, ARGTYPE_BOOL },
+       {"shortname", &opt_sm_shortname, "Sort by waypoint short name", 
+               NULL, ARGTYPE_BOOL },
+       {"description", &opt_sm_description, "Sort by waypoint description", 
+               NULL, ARGTYPE_BOOL },
+       {0, 0, 0, 0, 0}
 };
 
 static int
index 963e7572a547262660865b47bb102263cfb6967b..d581bbb52d5c5802f260134a3c05c7f8c93b0a10 100644 (file)
@@ -37,15 +37,22 @@ static int  swapdepth = 0;
 
 static
 arglist_t stackfilt_args[] = {
-       {"push", &opt_push, "Push waypoint list onto stack", ARGTYPE_BOOL},
-       {"copy", &opt_copy, "Copy waypoint list when pushing", ARGTYPE_BOOL},
-       {"pop", &opt_pop, "Pop waypoint list from stack", ARGTYPE_BOOL},
-       {"append", &opt_append, "Append list when popping", ARGTYPE_BOOL},
-       {"discard", &opt_discard, "Discard top of stack when popping", ARGTYPE_BOOL},
-       {"replace", &opt_replace, "Replace list with top of stack (default)", ARGTYPE_BOOL},
-       {"swap", &opt_swap, "Swap waypoint list with <depth> item on stack", ARGTYPE_BOOL},
-       {"depth", &opt_depth, "Item to use when swapping", ARGTYPE_INT},
-       {0, 0, 0, 0}
+       {"push", &opt_push, "Push waypoint list onto stack", NULL, 
+               ARGTYPE_BOOL},
+       {"copy", &opt_copy, "Copy waypoint list when pushing", NULL,
+               ARGTYPE_BOOL},
+       {"pop", &opt_pop, "Pop waypoint list from stack", NULL,
+               ARGTYPE_BOOL},
+       {"append", &opt_append, "Append list when popping", NULL,
+               ARGTYPE_BOOL},
+       {"discard", &opt_discard, "Discard top of stack when popping", 
+               NULL, ARGTYPE_BOOL},
+       {"replace", &opt_replace, "Replace list with top of stack (default)", 
+               NULL, ARGTYPE_BOOL},
+       {"swap", &opt_swap, "Swap waypoint list with <depth> item on stack", 
+               NULL, ARGTYPE_BOOL},
+       {"depth", &opt_depth, "Item to use when swapping", NULL, ARGTYPE_INT},
+       {0, 0, 0, 0, 0}
 };
 
 struct stack_elt {
index d21a424136b849baf8ad465eab5f24c8f19da096..b369e75002055a24640a9bf6d355c6d811c19303 100644 (file)
@@ -36,12 +36,13 @@ static char *includelogs = NULL;
 static
 arglist_t text_args[] = {
        { "nosep", &suppresssep, 
-               "Suppress separator lines between waypoints", ARGTYPE_BOOL },
+               "Suppress separator lines between waypoints", 
+               NULL, ARGTYPE_BOOL },
        { "encrypt", &encrypt,
-               "Encrypt hints using ROT13", ARGTYPE_BOOL },
+               "Encrypt hints using ROT13", NULL, ARGTYPE_BOOL },
        { "logs", &includelogs,
-                "Include groundspeak logs if present", ARGTYPE_BOOL },
-       {0, 0, 0, 0}
+                "Include groundspeak logs if present", NULL, ARGTYPE_BOOL },
+       {0, 0, 0, 0, 0}
 };
 
 
@@ -225,5 +226,6 @@ ff_vecs_t text_vecs = {
        wr_deinit,
        NULL,
        data_write,
+       NULL, 
        text_args
 };
index b717f65bd46232bd2c678ad8fedc14d93dd49138..e0fdfd4f10e2ee376075dbd3cfbdbfdda584b77b 100644 (file)
@@ -37,21 +37,13 @@ static char *suppresswhite = NULL;
 static char *iconismarker = NULL;
 static char *snlen = NULL;
 
-static char *margin  = "15%";
-static char *xpixels = "768";
-static char *ypixels = "768";
-static char *oldthresh = "14";
-static char *oldmarker  = "redpin";
-static char *newmarker  = "greenpin";
-static char *unfoundmarker  = "bluepin";
-
-static char *optmargin = NULL;
-static char *optxpixels = NULL;
-static char *optypixels = NULL;
-static char *optoldthresh = NULL;
-static char *optoldmarker = NULL;
-static char *optnewmarker = NULL;
-static char *optunfoundmarker = NULL;
+static char *margin  = NULL; 
+static char *xpixels = NULL; 
+static char *ypixels = NULL;
+static char *oldthresh = NULL;
+static char *oldmarker  = NULL;
+static char *newmarker  = NULL;
+static char *unfoundmarker  = NULL;
 
 int scalev;
 int short_length;
@@ -71,47 +63,43 @@ static char *clickmap = NULL;
 static
 arglist_t tiger_args[] = {
        {"nolabels", &nolabels, "Suppress labels on generated pins.",
-               ARGTYPE_BOOL },
+               NULL, ARGTYPE_BOOL },
        {"genurl", &genurl, "Generate file with lat/lon for centering map.",
-               ARGTYPE_OUTFILE },
-       {"margin", &optmargin, "Margin for map.  Degrees or percentage.",
-               ARGTYPE_FLOAT},
+               NULL, ARGTYPE_OUTFILE },
+       {"margin", &margin, "Margin for map.  Degrees or percentage.",
+               "15%", ARGTYPE_FLOAT},
        {"snlen", &snlen, "Max shortname length when used with -s.",
-               ARGTYPE_INT},
-       {"oldthresh", &optoldthresh, "Days after which points are considered old.",
-               ARGTYPE_INT},
-       {"oldmarker", &optoldmarker, "Marker type for old points.",
-               ARGTYPE_STRING},
-       {"newmarker", &optnewmarker, "Marker type for new points.",
-               ARGTYPE_STRING},
+               NULL, ARGTYPE_INT},
+       {"oldthresh", &oldthresh, 
+               "Days after which points are considered old.",
+               "14", ARGTYPE_INT},
+       {"oldmarker", &oldmarker, "Marker type for old points.",
+               "redpin", ARGTYPE_STRING},
+       {"newmarker", &newmarker, "Marker type for new points.",
+               "greenpin", ARGTYPE_STRING},
        {"suppresswhite", &suppresswhite,
-               "Suppress whitespace in generated shortnames", ARGTYPE_BOOL },
-       {"unfoundmarker", &optunfoundmarker, "Marker type for unfound points.",
-               ARGTYPE_STRING},
-       {"xpixels", &optxpixels, "Width in pixels of map.",
-               ARGTYPE_INT},
-       {"ypixels", &optypixels, "Height in pixels of map.",
-               ARGTYPE_INT},
+               "Suppress whitespace in generated shortnames", 
+               NULL, ARGTYPE_BOOL },
+       {"unfoundmarker", &unfoundmarker, "Marker type for unfound points.",
+               "bluepin", ARGTYPE_STRING},
+       {"xpixels", &xpixels, "Width in pixels of map.",
+               "768", ARGTYPE_INT},
+       {"ypixels", &ypixels, "Height in pixels of map.",
+               "768", ARGTYPE_INT},
        {"iconismarker", &iconismarker,
-               "The icon description is already the marker", ARGTYPE_BOOL },
+               "The icon description is already the marker", NULL,
+               ARGTYPE_BOOL },
 #if CLICKMAP
        {"clickmap", &clickmap, "Generate Clickable map web page.",
-               ARGTYPE_BOOL},
+               NULL, ARGTYPE_BOOL},
 #endif
-       {0, 0, 0, 0}
+       {0, 0, 0, 0, 0}
 };
 
 
 static void
 rd_init(const char *fname)
 {
-       margin  = optmargin?optmargin:"15%";
-       xpixels = optxpixels?optxpixels:"768";
-       ypixels = optypixels?optypixels:"768";
-       oldthresh = optoldthresh?optoldthresh:"14";
-       oldmarker  = optoldmarker?optoldmarker:"redpin";
-       newmarker  = optnewmarker?optnewmarker:"greenpin";
-       unfoundmarker  = optunfoundmarker?optunfoundmarker:"bluepin";
        file_in = xfopen(fname, "r", MYNAME);
        mkshort_handle = mkshort_new_handle();
 }
@@ -126,13 +114,6 @@ rd_deinit(void)
 static void
 wr_init(const char *fname)
 {
-       margin  = optmargin?optmargin:"15%";
-       xpixels = optxpixels?optxpixels:"768";
-       ypixels = optypixels?optypixels:"768";
-       oldthresh = optoldthresh?optoldthresh:"14";
-       oldmarker  = optoldmarker?optoldmarker:"redpin";
-       newmarker  = optnewmarker?optnewmarker:"greenpin";
-       unfoundmarker  = optunfoundmarker?optunfoundmarker:"bluepin";
        file_out = xfopen(fname, "w", MYNAME);
        thresh_days = strtod(oldthresh, NULL);
 }
@@ -302,5 +283,6 @@ ff_vecs_t tiger_vecs = {
        wr_deinit,
        data_read,
        data_write,
+       NULL, 
        tiger_args,
 };
index c66f92b732411485d9f4a45b5635490451a86855..3fab6bbee6fe9078e72b41f633b075ebd9d78414 100644 (file)
@@ -307,6 +307,9 @@ exit_vecs( void )
        vecs_t *vec = vec_list;
        while ( vec->vec ) {
                arglist_t *ap;
+               if ( vec->vec->exit ) {
+                       (*vec->vec->exit)();
+               }
                if ( vec->vec->args ) {
                        for ( ap = vec->vec->args; ap->argstring; ap++ ) {
                                if ( ap->argval && *ap->argval ) {
@@ -342,12 +345,37 @@ find_vec(char *const vecname, char **opts)
 
                        if (vec->vec->args) {
                                for (ap = vec->vec->args; ap->argstring; ap++){
+                                       char *opt = NULL; 
                                        if ( *ap->argval ) xfree(*ap->argval);
-                                       *ap->argval = get_option(*opts, ap->argstring);
+                                       
+                                       opt = get_option(*opts, ap->argstring);
+                                       if ( opt ) {
+                                               *ap->argval = opt;
+                                       }
+                                       else if ( ap->defaultvalue ) {
+                                               *ap->argval = xstrdup( 
+                                                       ap->defaultvalue );
+                                       }
+                                       else {
+                                               *ap->argval = NULL;
+                                       }
                                }
                        }
                } else {
                        *opts = NULL;
+                       if (vec->vec->args) {
+                               for (ap = vec->vec->args; ap->argstring; ap++){
+                                       if ( *ap->argval ) xfree(*ap->argval);
+                                       
+                                       if ( ap->defaultvalue ) {
+                                               *ap->argval = xstrdup( 
+                                                       ap->defaultvalue );
+                                       }
+                                       else {
+                                               *ap->argval = NULL;
+                                       }
+                               }
+                       }
                }
 
                xfree(v);
index 3ffb50efaa8e9ce2cd2a07aa260bab2f88677ac2..fe22c83dc0b2372f3e03beecaec27923e867f1c5 100644 (file)
 #define MYNAME "XCSV"
 #define ISSTOKEN(a,b) (strncmp(a,b, strlen(b)) == 0)
 
-static char *styleopt;
-static char *snlenopt;
-static char *snwhiteopt;
-static char *snupperopt;
-static char *snuniqueopt;
-char *prefer_shortnames;
-char *xcsv_urlbase;
+static char *styleopt = NULL;
+static char *snlenopt = NULL;
+static char *snwhiteopt = NULL;
+static char *snupperopt = NULL;
+static char *snuniqueopt = NULL;
+char *prefer_shortnames = NULL;
+char *xcsv_urlbase = NULL;
 
 static
 arglist_t xcsv_args[] = {
-       {"style", &styleopt, "Full path to XCSV style file",
+       {"style", &styleopt, "Full path to XCSV style file", NULL,
                ARGTYPE_FILE | ARGTYPE_REQUIRED },
-       {"snlen", &snlenopt, "Max synthesized shortname length",
+       {"snlen", &snlenopt, "Max synthesized shortname length", NULL,
                ARGTYPE_INT},
        {"snwhite", &snwhiteopt, "(0/1) Allow whitespace synth. shortnames",
-               ARGTYPE_BOOL},
+               NULL, ARGTYPE_BOOL},
        {"snupper", &snupperopt, "(0/1) UPPERCASE synth. shortnames",
-               ARGTYPE_BOOL},
+               NULL, ARGTYPE_BOOL},
        {"snunique", &snuniqueopt, "(0/1) Make synth. shortnames unique",
-               ARGTYPE_BOOL},
+               NULL, ARGTYPE_BOOL},
        {"urlbase", &xcsv_urlbase, "Basename prepended to URL on output",
-               ARGTYPE_STRING},
+               NULL, ARGTYPE_STRING},
        {"prefer_shortnames", &prefer_shortnames, 
-               "Use shortname instead of description", ARGTYPE_BOOL },
-       {0, 0, 0, 0}
+               "Use shortname instead of description", 
+               NULL, ARGTYPE_BOOL },
+       {0, 0, 0, 0, 0}
 };
 
 /* a table of config file constants mapped to chars */
@@ -542,5 +543,6 @@ ff_vecs_t xcsv_vecs = {
     xcsv_wr_deinit,
     xcsv_data_read,
     xcsv_data_write,
+    NULL, 
     xcsv_args
 };